package cn.zswltech.gruul.biz.service;

import cn.zswltech.gruul.biz.support.service.IService;
import cn.zswltech.gruul.common.dto.*;
import cn.zswltech.gruul.common.result.Response;
import cn.zswltech.gruul.common.entity.CustomTreeDO;
import cn.zswltech.gruul.common.entity.DisplayGroupDO;

import java.util.List;
import java.util.Map;

public interface CustomTreeService extends IService<CustomTreeDO> {
    Response<Map> createCustomTree(CustomTreeDO customTreeDO);

    Response<Map> createCustomTreeMenu(String params);

    Response updateCustomTree(CustomTreeDO customTreeDO);

    Response deleteCustomTree(Long id);

    Response<List<CustomTreeDO>> getCustomTreeList();

    Response groupSort(String groupIds);

    Response menuSort(Long groupId, String menuIds);

    List<DisplayGroupDO> getMenu(Map<Long,DisplayGroupDO> groups);

    /**
     * 根据functionId获取最顶级分组
     * @param functionId
     * @return
     */
    CustomTreeDO queryFirstCustomTreeByFunctionId(Long functionId);


    // 找到该分组下所有menuId
    List<Long> queryAllMenusInCustomTree(String code);

    /**
     * 获取菜单树
     * @param systemCode 系统编号
     * @return
     */
    List<MenuTreeInfo> appMenuTree(String systemCode);

    /**
     * 新增菜单分组
     * @param req
     */
    void addMenuGroup(MenuGroupAddREQ req);

    /**
     * 修改菜单分组
     * @param req
     */
    void updateMenuGroup(MenuGroupUpdateREQ req);

    /**
     * 删除菜单分组
     * @param req
     */
    void delMenuGroup(MenuGroupDelREQ req);
}
